/*
**a compiler avec -ldl -rdynamic sous linux
*/

#include <iostream>

#include "x_dynlib.h"

int main()
{
  DL_HANDLER handle;
  int (*ptr)();

  handle = DL_OPEN("php_mod");
  if (DL_HANDLER_IS_OK(handle))
    {
      ptr = (int (*)()) DL_GET_SYM(handle, "module_new");
      if (ptr != NULL)
	std::cout << (*ptr)();
      else
	std::cerr << "Pointer error" << std::endl;
      DL_CLOSE(handle);
    }
  else
    std::cerr << "Handle error:" << std::endl;
  return (0);
}
